package com.easy.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.grpc.internal.ClientStream;
import lombok.Data;
import org.apache.poi.ss.formula.functions.T;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;
@Data
@TableName("user_address")
public class Address implements Serializable {
    private static final long serialVersionUID = 1L;
//    private List<T> list;
    @TableId(type = IdType.AUTO)
    private Integer id;
    private Integer userId;
    private String phone;
    private String province;
    private String city;
    private String district;
    private String address;
    private Integer isDefault;
    private LocalDateTime date;

    @TableField(exist = false)
    private String fullAddress;  // 拼接后的完整地址

    // 拼接省、市、区和详细地址
    public String getFullAddress() {
        return (province != null ? province : "") +
                (city != null ? city : "") +
                (district != null ? district : "") +
                (address != null ? address : "");
    }
}
